<!DOCTYPE html>
<html>

<head>
    <title>Example</title>
    <style type="text/css">
        /* :focus 匹配当前获得焦点的元素 */
        :focus{
            border: thin black solid;
            padding: 4px;
        }
    </style>
</head>

<body>
    <form>
        Name: <input type="text" name="name"/>
        <p>
            City: <input type="text" name="city"/>
        </p>
        <input type="submit">
    </form>
</body>

</html>